import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/login',
    name: 'login',
    component: () => import(/* webpackChunkName: "login" */'@/views/login.vue'),
    meta: {
      title: '登录'
    }
  },
  {
    path: '/',
    name: 'layout',
    component: () => import(/* webpackChunkName: "layout" */'@/layout/index'),
    children: [
      {
        path: '',
        name: 'index',
        component: () => import(/* webpackChunkName: "index" */'@/views/index'),
        meta: {
          title: '首页设置'
        }
      },
      {
        path: '/shareFile',
        name: 'shareFile',
        component: () => import(/* webpackChunkName: "shareFile" */'@/views/shareFile/shareFile'),
        meta: {
          title: '共享文件'
        }
      },
      {
        path: '/personFile',
        name: 'personFile',
        component: () => import(/* webpackChunkName: "personFile" */'@/views/personFile/personFile'),
        meta: {
          title: '个人文件'
        }
      },
      {
        path: '/roleManage',
        name: 'roleManage',
        component: () => import(/* webpackChunkName: "roleManage" */'@/views/roleManage/roleManage'),
        meta: {
          title: '角色管理'
        }
      },
      {
        path: '/userManage',
        name: 'userManage',
        component: () => import(/* webpackChunkName: "userList" */'@/views/userManage/userManage'),
        meta: {
          title: '用户管理',
          parent: ['公司管理', '用户管理']
        }
      },
      {
        path: '/resourceManage',
        name: 'resourceManage',
        component: () => import(/* webpackChunkName: "resourceManage" */'@/views/resourceManage/resourceManage'),
        meta: {
          title: '资源管理'
        }
      },
      {
        path: '/departmentManage',
        name: 'departmentManage',
        component: () => import(/* webpackChunkName: "departmentManage" */'@/views/departmentManage/departmentList'),
        meta: {
          title: '部门管理',
          parent: ['公司管理', '部门管理', '还有一个部门']
        }
      },
      {
        path: '/postManage',
        name: 'postManage',
        component: () => import(/* webpackChunkName: "postManage" */'@/views/postManage/postManage'),
        meta: {
          title: '职务管理'
        }
      },
      {
        path: '/noticeManage',
        name: 'noticeManage',
        component: () => import(/* webpackChunkName: "noticeManage" */'@/views/noticeManage/noticeManage'),
        meta: {
          title: '全体公告'
        }
      },
      {
        path: '/projectManage',
        name: 'projectManage',
        component: () => import(/* webpackChunkName: "projectManage" */'@/views/projectManage/projectManage'),
        meta: {
          title: '项目管理'
        }
      },
      {
        path: '/projectDetailManage',
        name: 'projectDetailManage',
        component: () => import(/* webpackChunkName: "projectDetailManage" */'@/views/projectManage/projectDetailManage'),
        meta: {
          title: '项目详情'
        }
      },
      {
        path: '/brainMap',
        name: 'brainMap',
        component: () => import(/* webpackChunkName: "brainMap" */'@/views/onlineDocument/brainMap'),
        meta: {
          title: '脑图'
        }
      },
      {
        path: '/dailyReport',
        name: 'dailyReport',
        component: () => import(/* webpackChunkName: "dailyReport" */'@/views/reportManage/dailyReport'),
        meta: {
          title: '日报'
        }
      },
      {
        path: '/mySpace',
        name: 'mySpace',
        component: () => import(/* webpackChunkName: "mySpace" */'@/views/mySpace/mySpace'),
        meta: {
          title: '我的空间'
        }
      },
      {
        path: '/shareSpace',
        name: 'shareSpace',
        component: () => import(/* webpackChunkName: "shareSpace" */'@/views/shareSpace/shareSpace'),
        meta: {
          title: '共享空间'
        }
      }
    ]
  },
  {
    path: '/404',
    name: '404',
    component: () => import(/* webpackChunkName: "404" */'@/views/404'),
    meta: {
      title: '无法访问该页面'
    }
  },
  {
    path: '/404',
    name: '404',
    component: () => import(/* webpackChunkName: "404" */'@/views/404'),
    meta: {
      title: '无法访问该页面'
    }
  },
  {
    path: '/test',
    name: 'test',
    component: () => import(/* webpackChunkName: "test" */'@/views/test'),
    meta: {
      title: '无法访问该页面'
    }
  },
  {
    path: '/test1',
    name: 'test1',
    component: () => import(/* webpackChunkName: "test1" */'@/views/test1'),
    meta: {
      title: '无法访问该页面'
    }
  },
  {
    path: '/excel',
    name: 'excel',
    component: () => import(/* webpackChunkName: "excel" */'@/components/document/excel'),
    meta: {
      title: 'excel文档'
    }
  },
  {
    path: '/:catchAll(.*)',
    redirect: '/404'
  }
]
const router = createRouter({
  history: createWebHashHistory('/'),
  routes
})

export default router
